import { IMessage, MessageType } from './types'
/**处理消息 */
export const handleChatMessage = (message: IMessage[]) => {
  const content_msg = message.filter(v => v.MsgType === MessageType.CONTENT_MSG) // 文本消息
  const prize_msg = message.find(v => v.MsgType === MessageType.PRIZE_MSG) // 奖励消息
  return {
    content_msg,
    prize_msg,
  }
}

// 处理图片的展示
export const handleImagShow = (url: string) => {
  return `${import.meta.env.VITE_APP_IMG_HOST_API}/${url}`
}
